package com.liuyh.demo.shardingjdbctest.keyGen;

import org.apache.shardingsphere.spi.keygen.ShardingKeyGenerator;

import java.util.Properties;
import java.util.Random;

public class TestKeyGen implements ShardingKeyGenerator {

    private volatile int id = new Random().nextInt();
    @Override
    public Comparable<?> generateKey() {
        return id++;
    }

    @Override
    public String getType() {
        return "demo";
    }

    @Override
    public Properties getProperties() {
        return null;
    }

    @Override
    public void setProperties(Properties properties) {

    }
}
